#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <map>
#include <climits>


using namespace std;

class Solution {
public:
    bool findNumberIn2DArray(vector<vector<int>>& matrix, int target) {
        if(matrix.size()<=0||matrix[0].size()<=0){
            return false;
        }
        int n=matrix.size(),m=matrix[0].size();
        int r=0,c=m-1;
        while(r<n && c>=0){
            if(matrix[r][c]==target){
                return true;
            }

            if(matrix[r][c]>target){
                c--;
            }else 
                r++;
        }
        return false;
    }
};

int main(){




    return 0;
}